<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<title>第一个微信二维码</title>
	<link rel="stylesheet" href="" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
	<img alt="扫码登录" th:src="${codeImg}" />
	<span th:text="${uuid}"></span>
	<input type="hidden" id="uuid" th:value="${uuid}" />
	<div id="msg"></div>
</body>
</html>
<script>
var t = setTimeout('login()',1000);
var uuid = $('#uuid').val();
console.log("uuid:"+uuid);
function login(){
	if(uuid != '' && uuid != undefined){
		console.log("进入登录等待...");
		clearTimeout(t);
		$.post('/wxlogin',{uuid:uuid},function(data){
			if(data.code=="0"){
				console.log(data.message);
				$('#msg').html(data.message);
			}
		});
	}else{
		t = setTimeout('login()',1000);
		console.log("uuid 为空");
	}
}

</script>